#include "descriptorManager.h"
#include "common.h"
#include "display.h"



int main(int argc, char** argv) {
  log_init();
  g_log_context.log_level = LOG_DEBUG;
  int ret;

  FILE* fp = fopen(argv[1], "r");assert(fp);
  DisplayFix fix;
  char* buff = (char*)malloc(MAX_DISPLAY_SIZE);assert(buff);

  while(1) {
    ret = fread(&fix, sizeof(DisplayFix), 1, fp);
    if(ret != 1 && feof(fp)) {
      NOTICE("finish");
      return 0;
    }

    NOTICE("id=%u len=%u",
	fix.id, fix.size);

    ret = fread(buff, fix.size, 1, fp);
    assert(ret == 1);

    fprintf(stderr, "[INFO:%s]", buff);
  }

  return 0;
}

